﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddStudentInfo.aspx.cs" Inherits="ZX.WebApp.Crm.Deliver.AddStudentInfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/paginator/paginator-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/event-delegate/event-delegate-min.js"></script>
    <script src="../../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.json-2.2.js" type="text/javascript"></script>
    <script src="../../Scripts/Jquery.form.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.calendar.js" type="text/javascript"></script>
    <link href="../../Styles/default/calendar.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
    </style>
</head>  
<body>
    <form id="form1" runat="server">
    <div>
        <table>
            <tr>
                <td colspan="4" align="center" style="height:35px; font-weight:bold;">学员信息</td>
            </tr>
            <tr height="35">
                <td align="right" width="90">学员姓名：</td>
                <td><asp:TextBox ID="ClassName" runat="server"></asp:TextBox>
                    <span style="color:Red;">*</span>
                </td>
                <td align="right" width="90">身份证号：</td>
                <td><asp:TextBox ID="IDCard" runat="server"></asp:TextBox>
                    <span style="color:Red;">*</span>
                </td>
            </tr>
            <tr height="35">
                <td align="right">性别：</td>
                <td><asp:DropDownList ID="Sex" runat="server" Width="155">
                    <asp:ListItem Value="男">男</asp:ListItem>
                    <asp:ListItem Value="女">女</asp:ListItem>
                </asp:DropDownList></td>
                <td align="right">职务：</td>
                <td><asp:TextBox ID="Post" runat="server"></asp:TextBox>
                    <span style="color:Red;">*</span>
                </td>
            </tr>
            <tr height="35">
                <td align="right">是否决策人：</td>
                <td><asp:DropDownList ID="IsDecision" runat="server" Width="155">
                    <asp:ListItem Value="0">否</asp:ListItem>
                    <asp:ListItem Value="1">是</asp:ListItem>
                </asp:DropDownList></td>
                <td align="right">到达日期：</td>
                <td><asp:TextBox ID="ArriveatTime" runat="server" ReadOnly="true"></asp:TextBox>
                    <span style="color:Red;">*</span>
                </td>
            </tr>
            <tr height="35">
                <td align="right">房型：</td>
                <td><asp:DropDownList ID="HouseType" runat="server" Width="155">
                </asp:DropDownList></td>
                <td align="right">交通方式：</td>
                <td><asp:DropDownList ID="TrafficType" runat="server" Width="155">
                </asp:DropDownList></td>
            </tr>
            <tr height="35">
                <td align="right">是否签订：</td>
                <td><asp:DropDownList ID="IsSignIn" runat="server" Width="155">
                    <asp:ListItem Value="1">是</asp:ListItem>
                    <asp:ListItem Value="0">否</asp:ListItem>
                </asp:DropDownList></td>
                <td align="right">航班号：</td>
                <td>
                    <asp:TextBox ID="FlightNum" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr height="35">
                <td align="right">备注：</td>
                <td colspan="3">
                    <asp:TextBox ID="Explain" runat="server" TextMode="MultiLine" Width="410" Height="50"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td><asp:CheckBox ID="chkGoOn" runat="server" Text="连续添加" Checked="true" /></td>
            </tr>
            
        </table>
    </div>
    <input type="hidden" id="MajorID" runat="server" />
    </form>
    <form id="form2" style="display: none" action="../../Extend/AjaxData/DataSave.aspx">
    <textarea style="display: none" id="jsonDataContent" rows="2" cols="2" name="jsonDataContent"></textarea>
    </form>
</body>
<script type="text/javascript">
    <asp:Literal ID="EditTemplate" runat="server"></asp:Literal>
    $(document).ready(function () {
        $('#ArriveatTime').cld();
    });
    function SaveStudents() {
        setValue();
        if(instance[0].MajorID=="" || instance[0].MajorID==null){
            alert("数据异常,保存失败!");
            return;
        }
        if(instance[0].ClassName==""||instance[0].ClassName==null){
            alert("学员名称不能为空!");
            $("#ClassName").focus();
            return;
        }
        if(instance[0].IDCard==""||instance[0].IDCard==null){
            alert("身份证号不能为空!");
            $("#IDCard").focus();
            return;
        }
        if(instance[0].Post==""||instance[0].Post==null){
            alert("职务不能为空!");
            $("#Post").focus();
            return;
        }
        if(instance[0].ArriveatTime==""||instance[0].ArriveatTime==null){
            alert("到达日期不能为空!");
            $("#ArriveatTime").focus();
            return;
        }
        var json = $.toJSON(instance[0]).replace(/'/g, "[B]");
        $("#jsonDataContent").val(json);
        Save(json);
        //trySave();
    }
    function Save(obj){
        
    }
    function trySave(){
        var url = "../../Extend/AjaxData/DataSave.aspx?action=insert&flag=1&entity=CrmMajorStutent";
        var formObject = document.getElementById('form2');
        YAHOO.util.Connect.setForm(formObject);
        var cObj = YAHOO.util.Connect.asyncRequest('POST', url, callback);
    }
    function setValue(){
        instance[0].MajorID = $("#MajorID").val();
        instance[0].ClassName = $("#ClassName").val();
        instance[0].IDCard = $("#IDCard").val();
        instance[0].Sex = $("#Sex").val();
        instance[0].Post = $("#Post").val();
        instance[0].IsDecision = $("#IsDecision").val();
        instance[0].ArriveatTime = $("#ArriveatTime").val();
        instance[0].TrafficType = $("#TrafficType").val();
        instance[0].FlightNum = $("#FlightNum").val();
        instance[0].IsSignIn = $("#IsSignIn").val();
        instance[0].Explain = $("#Explain").val();
    }
    var responseSuccess = function (res) {
        try {
            var str = res.responseText;
            if (str == "1") {
                alert("数据保存成功!");
                $("#ClassName").val("");
                $("#IDCard").val("");
                $("#Post").val("");
                $("#ArriveatTime").val("");
                $("#FlightNum").val("");
                $("#Explain").val("");
            }
            else {
                alert(str);
            }
        } catch (e) {
        }
        finally {
        }
    }
    var responseFailure = function (error) {
        alert("数据错误：" + error.statusText);
    }
    var callback = {
        success: responseSuccess,
        failure: responseFailure
    };
</script>
</html>
